/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package services;

import facade.AccionFacadeLocal;
import javax.ejb.EJB;
import javax.jws.Oneway;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import java.util.List;

/**
 *
 * @author ari
 */
@WebService(serviceName = "AccionWebService")
public class AccionWebService {
    @EJB
    private AccionFacadeLocal accionFacade;

    /**
     * Web service operation
     */
    @WebMethod(operationName = "deleteAccion")
    @Oneway
    public void deleteAccion(@WebParam(name = "id") Long id) {
        accionFacade.deleteAccion(id);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getEmpresas")
    public List<String> getEmpresas() {
        //TODO write your implementation code here:
        return accionFacade.getEmpresas();
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "consultaVentasEmp")
    public Object[] consultaVentasEmp(@WebParam(name = "empresa") String empresa) {
        //TODO write your implementation code here:
        return accionFacade.consultaVentasEmp(empresa);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "consultaComprasEmp")
    public Object[] consultaComprasEmp(@WebParam(name = "empresa") String empresa) {
        //TODO write your implementation code here:
        return accionFacade.consultaComprasEmp(empresa);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "obtenerInfo")
    public Object[] obtenerInfo(@WebParam(name = "id") Long id) {
        //TODO write your implementation code here:
        return accionFacade.obtenerInfo(id);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getComprasInv")
    public List<Object[]> getComprasInv(@WebParam(name = "login") String login) {
        //TODO write your implementation code here:
        return accionFacade.getComprasInv(login);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getVentasInv")
    public List<Object[]> getVentasInv(@WebParam(name = "login") String login) {
        //TODO write your implementation code here:
        return accionFacade.getVentasInv(login);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "createCompra")
    @Oneway
    public void createCompra(@WebParam(name = "empresa") String empresa, @WebParam(name = "num") int num, @WebParam(name = "monto") double monto, @WebParam(name = "login") String login) {
        accionFacade.createCompra(empresa, num, monto, login);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "createVenta")
    @Oneway
    public void createVenta(@WebParam(name = "empresa") String empresa, @WebParam(name = "num") int num, @WebParam(name = "monto") double monto, @WebParam(name = "login") String login) {
        accionFacade.createVenta(empresa, num, monto, login);
    }
        
}
